using UnityEngine;
using System.Collections;

public class AtlasMenu : MonoBehaviour 
{
	public static Texture2D globalTexture;
	public static Rect[] rects;
	private Texture2D[] textures;
	
	public static Material globalMaterial;
	
	void Awake()
	{
		textures = new Texture2D[4];
		
		this.textures[0] = ((Texture2D)Resources.Load("Textures/Menu/Jogar"));
		this.textures[1] = ((Texture2D)Resources.Load("Textures/Menu/Instru"));		
		this.textures[2] = ((Texture2D)Resources.Load("Textures/Menu/Creditos"));
		this.textures[3] = ((Texture2D)Resources.Load("Textures/Menu/Menu"));
		
		globalTexture = AtlasTexture.Create(this.textures,out rects);
			
		globalMaterial = new Material((Shader)Resources.Load ("Shader/Basic2D"));
		globalMaterial.mainTexture = globalTexture;
	}
}